package com.zz.framework.core.config

import com.zz.framework.core.ext.fromJson
import com.zz.framework.core.ext.toJson
import com.zz.framework.core.utils.XPreference

/**
 * Copyright © 2025 zhun All rights reserved.
 * Created by ZhaoZhun on 2025/2/17 20:57.
 * @author: ZhaoZhun 1820022519@qq.com
 * @version: V1.0
 */
object GlobalSetting {
    // 读超时
    const val READ_TIME_OUT = 60L

    // 写超时
    const val WRITE_TIME_OUT = 60L

    // 连接超时
    const val CONNECT_TIME_OUT = 30L
//
//    private const val SP_TOKEN = "SHARED_PREFERENCES_TOKEN"
//    private const val SHARED_PREFERENCES_LANGUAGE_CODE = "SHARED_PREFERENCES_LANGUAGE_CODE"
//    private const val SHARED_PREFERENCES_LANGUAGE_LIST = "SHARED_PREFERENCES_LANGUAGE_LIST"
//    private const val SHARED_PREFERENCES_APP_VERSION = "SHARED_PREFERENCES_APP_VERSION"
//    private const val SHARED_PREFERENCES_SPOT_VERSION = "SHARED_PREFERENCES_SPOT_VERSION"
//    private const val SHARED_PREFERENCES_TOUR_GUIDE_COMMENTARY_VERSION = "SHARED_PREFERENCES_TOUR_GUIDE_COMMENTARY_VERSION"
//    private const val SHARED_PREFERENCES_DIGITAL_HUMAN_VERSION = "SHARED_PREFERENCES_DIGITAL_HUMAN_VERSION"
//    private const val SHARED_PREFERENCES_ELECTRONIC_FENCE_VERSION = "SHARED_PREFERENCES_ELECTRONIC_FENCE_VERSION"
//    private const val SHARED_PREFERENCES_TOUR_GUIDE_COMMENTARY = "SHARED_PREFERENCES_TOUR_GUIDE_COMMENTARY"
//    private const val SHARED_PREFERENCES_DIGITAL_HUMAN = "SHARED_PREFERENCES_DIGITAL_HUMAN"
//    private const val SHARED_PREFERENCES_SPOT_INFO = "SHARED_PREFERENCES_SPOT_INFO"
//    private const val SHARED_PREFERENCES_FENCE = "SHARED_PREFERENCES_FENCE"
//
//
//    var spFence: String by XPreference(SHARED_PREFERENCES_FENCE, "")
//    fun <T : Any> setFence(entity: T?) {
//        spFence = entity?.toJson().orEmpty()
//    }
//
//    inline fun <reified T> getFence(): T {
//        return spFence.fromJson<T>()
//    }
//
//
//    var spSpotInfo: String by XPreference(SHARED_PREFERENCES_SPOT_INFO, "")
//    fun <T : Any> setSpotInfo(entity: T?) {
//        spSpotInfo = entity?.toJson().orEmpty()
//    }
//
//    inline fun <reified T> getSpotInfo(): T {
//        return spSpotInfo.fromJson<T>()
//    }
//
//
//    var spDigitalHuman: String by XPreference(SHARED_PREFERENCES_DIGITAL_HUMAN, "")
//    fun <T : Any> setDigitalHuman(entity: T?) {
//        spDigitalHuman = entity?.toJson().orEmpty()
//    }
//
//    inline fun <reified T> getDigitalHuman(): T {
//        return spDigitalHuman.fromJson<T>()
//    }
//
//
//    var spTourGuideCommentary: String by XPreference(SHARED_PREFERENCES_TOUR_GUIDE_COMMENTARY, "")
//
//    fun <T : Any> setTourGuideCommentary(entity: T?) {
//        spTourGuideCommentary = entity?.toJson().orEmpty()
//    }
//
//    inline fun <reified T> getTourGuideCommentary(): T {
//        return spTourGuideCommentary.fromJson<T>()
//    }
//
//
//    var spLanguageList: String by XPreference(SHARED_PREFERENCES_LANGUAGE_LIST, "")
//    fun <T : Any> setLanguageList(entity: List<T>?) {
//        spLanguageList = entity?.toJson().orEmpty()
//    }
//    inline fun <reified T> getLanguageList(): List<T> {
//        return spLanguageList.fromJson<List<T>>()
//    }
//
//
//    private var spAppVersion: String by XPreference(SHARED_PREFERENCES_APP_VERSION, "")
//    private var spSpotVersion: String by XPreference(SHARED_PREFERENCES_SPOT_VERSION, "")
//    private var spTourGuideCommentaryVersion: String by XPreference(SHARED_PREFERENCES_DIGITAL_HUMAN_VERSION, "")
//    private var spDigitalHumanVersion: String by XPreference(SHARED_PREFERENCES_TOUR_GUIDE_COMMENTARY_VERSION, "")
//    private var spElectronicFenceVersion: String by XPreference(SHARED_PREFERENCES_ELECTRONIC_FENCE_VERSION, "")
//
//    fun getAppVersion() = spAppVersion
//    fun setAppVersion(version: String) {
//        spAppVersion = version
//    }
//
//    fun getSpotVersion() = spSpotVersion
//    fun setSpotVersion(version: String) {
//        spSpotVersion = version
//    }
//
//    fun getTourGuideCommentaryVersion() = spTourGuideCommentaryVersion
//    fun setTourGuideCommentaryVersion(version: String) {
//        spTourGuideCommentaryVersion = version
//    }
//
//    fun getDigitalHumanVersion() = spDigitalHumanVersion
//    fun setDigitalHumanVersion(version: String) {
//        spDigitalHumanVersion = version
//    }
//
//    fun getElectronicFenceVersion() = spElectronicFenceVersion
//    fun setElectronicFenceVersion(version: String) {
//        spElectronicFenceVersion = version
//    }
//
//    private var spLanguageCode: String by XPreference(SHARED_PREFERENCES_LANGUAGE_CODE, "zh-CN")
//    fun getLanguageCode(): String = spLanguageCode
//    fun setLanguageCode(languageCode: String) {
//        spLanguageCode = languageCode
//    }
//
//    private var spToken: String by XPreference(SP_TOKEN, "")
//    fun getToken(): String {
//        return spToken
//    }
//
//    fun setToken(token: String? = "") {
//        spToken = token.orEmpty()
//    }
}